UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lSY0RxevniEbBaYVExwHztfs3+/4F7ELy00dyhyrQRE=' 
WHERE 
  key_id = '8a5df4fc1bf8b384a17e2a05d6cca477b15ee4b08492fdf1c1b23dd5d3c5f5bc' 
  AND (
    token = 'lSY0RxevniEbBaYVExwHztfs3+/4F7ELy00dyhyrQRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018