UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's93QhJkr819Ncwr72AzXIe5Lyz6ESzXNYRYSNWfenNM=' 
WHERE 
  key_id = '2f7b5b8b93da372a8c98d34858c807129812c630057a4d5802e0577f2dd98c21' 
  AND (
    token = 's93QhJkr819Ncwr72AzXIe5Lyz6ESzXNYRYSNWfenNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027