UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kjc6Dq/bzBgRNJoPAlbADcNZuR8pxbnylcYve22mCm0=' 
WHERE 
  key_id = '9b813b2164d36da4d768a0fc9071a03b0e38943bd87baff973c41407fc6c5df5' 
  AND (
    token = 'Kjc6Dq/bzBgRNJoPAlbADcNZuR8pxbnylcYve22mCm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019