UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WsYKnC08D7LF4ZmYdqKmhcqucEooMr723LmraBzdggc=' 
WHERE 
  key_id = '19ea724c7ab59d4c6ab4a89de0854a726061c82ef63a3ab7a1b78f5a279b12ea' 
  AND (
    token = 'WsYKnC08D7LF4ZmYdqKmhcqucEooMr723LmraBzdggc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052