UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o3jAzjxO8y/wr1GUQNPK1RheHI3KaoXeHxLECtC+0ws=' 
WHERE 
  key_id = 'e42800d2d2aa77d8f2bc50905b5950296f1ff0ee9a76943db1c95459a9f3df58' 
  AND (
    token = 'o3jAzjxO8y/wr1GUQNPK1RheHI3KaoXeHxLECtC+0ws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022