UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0T76OmRk+qRe5g+L81AxFYDPZ3GvAFefGxCsurLq4ew=' 
WHERE 
  key_id = '2c6775447527464c121bf6c5e4b6e2164cc22288fa04cc8240bd02b776d97d3c' 
  AND (
    token = '0T76OmRk+qRe5g+L81AxFYDPZ3GvAFefGxCsurLq4ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088