UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/jl9eakKcVPMzdRkk9Fnwd1IMEsgSbQ7nNMpsWj2PXI=' 
WHERE 
  key_id = 'c3c41961637133ded8ec0dec54426c56fa0107c344acf4c9ef5dc74e53c71bcb' 
  AND (
    token = '/jl9eakKcVPMzdRkk9Fnwd1IMEsgSbQ7nNMpsWj2PXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058