UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G5IxS9Vbpb1A0B/AauQ69z51rWCzvOdWwymRiCPSoqA=' 
WHERE 
  key_id = '9aa8feca8199e920c61f2f4746bafc83cbb7849bd10326f81ab5ac9ed962a41c' 
  AND (
    token = 'G5IxS9Vbpb1A0B/AauQ69z51rWCzvOdWwymRiCPSoqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039