UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vHaqp1Xn6Yna5zcg8hWFBsqAPiom0BBXG7RDbMnthe8=' 
WHERE 
  key_id = 'e7691024d8b279eb17761886492dc56d37c063b9f65312709af272c959c2f20f' 
  AND (
    token = 'vHaqp1Xn6Yna5zcg8hWFBsqAPiom0BBXG7RDbMnthe8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036