UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0RIL6A3DVmYw3Co1ql6grdnDdmGfe0XSnxU2Mg49vPA=' 
WHERE 
  key_id = 'cde9663054c9d8a01b441fcb3c301ab70d59741a28f1182dcb2f487376c0f524' 
  AND (
    token = '0RIL6A3DVmYw3Co1ql6grdnDdmGfe0XSnxU2Mg49vPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033