UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jba4Uun7xDPV8RWk1Yuv1feJQaKnokbkcDBmJGsKXdo=' 
WHERE 
  key_id = '724bbe0c8ef59c459224561f43e5327d3810c5a42ca87edd57b705e6fd2a78cb' 
  AND (
    token = 'jba4Uun7xDPV8RWk1Yuv1feJQaKnokbkcDBmJGsKXdo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040