UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3B4R1mvgDk0XlE2fQr2/TUx/dqQELD3I0ZrBq/A33qk=' 
WHERE 
  key_id = '087fd06d0a19abcdd940bf4546a01d67514a31756d40f9aa800942e868f1ed0b' 
  AND (
    token = '3B4R1mvgDk0XlE2fQr2/TUx/dqQELD3I0ZrBq/A33qk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034