UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZbU58kLTSmKhjulmVNhLQqqW3LP0/+tz70lLjww5Q3s=' 
WHERE 
  key_id = 'efb4f442f8e13088afed5afaa75ae01dca954e8bb0041aa9bd570f50abd897b7' 
  AND (
    token = 'ZbU58kLTSmKhjulmVNhLQqqW3LP0/+tz70lLjww5Q3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044