UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zDVqV8l5NdvC1+YfZ7Hu9y8xJ2YK3c7OzHwi4AtR/Es=' 
WHERE 
  key_id = '49f4d37f6228102cc8f6587ad0288e661ac50c28fa3c91b62b17343c3de559b3' 
  AND (
    token = 'zDVqV8l5NdvC1+YfZ7Hu9y8xJ2YK3c7OzHwi4AtR/Es=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037