UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+BW7EMrntWUibQ87HmbxeShemCwEs0qjlnu4oceQKQo=' 
WHERE 
  key_id = '0fbc251e4b1abd4b758fd9ace477007815a93fd9b3585fa7c5c0baed0c33f78c' 
  AND (
    token = '+BW7EMrntWUibQ87HmbxeShemCwEs0qjlnu4oceQKQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036