UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kZkGr2vkhHT6pRNKBxLRgSlkf1x7YmqizW4OUrTAf+o=' 
WHERE 
  key_id = '74f6eed719c79b683d4f6da8a9205b2518114e2e6e17cf74c03e796ce95930ed' 
  AND (
    token = 'kZkGr2vkhHT6pRNKBxLRgSlkf1x7YmqizW4OUrTAf+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051