UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8t7hu+qUQFVyXVMTFTmTSamtl94KXu18PApgNrKuLsM=' 
WHERE 
  key_id = '5238ba0a9c1fb32ad786e80c932d9ae11ee5d5aab3ff10cb3ebaccffd52a7239' 
  AND (
    token = '8t7hu+qUQFVyXVMTFTmTSamtl94KXu18PApgNrKuLsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034