UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RlWLtjr5O+c4JF/ol718k5aJu5I5bEgQwqzyTGAYFjg=' 
WHERE 
  key_id = '0f9f4dec85152af00c7e20606233e483c701b2b8293fd645b2d336907daf04f6' 
  AND (
    token = 'RlWLtjr5O+c4JF/ol718k5aJu5I5bEgQwqzyTGAYFjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022