UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CRC2DGrdYDYojKq4umeHWpdz27QA36zlPzRGxSO6IGo=' 
WHERE 
  key_id = '540e6b68aeb902587922e2dfd06dba7f9156a32473ffc5e402bc10da571b38f3' 
  AND (
    token = 'CRC2DGrdYDYojKq4umeHWpdz27QA36zlPzRGxSO6IGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035