UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOqCvCeYM0KUhXmR+E6pQMD5Nd4b86S1E4CjLVjPoTw=' 
WHERE 
  key_id = 'd26534000b49980a026634cbd71cc1ad3ac8a4838706417c651acb3b90ecf59f' 
  AND (
    token = 'JOqCvCeYM0KUhXmR+E6pQMD5Nd4b86S1E4CjLVjPoTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031