UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T0ufkdW72MUCTLs/buyOYgGfE1V9SfgVxK7Ai+fVo1U=' 
WHERE 
  key_id = '21caa9f04ab004df2f287e0927323b13b20b1be879aa84becef217465b306fa2' 
  AND (
    token = 'T0ufkdW72MUCTLs/buyOYgGfE1V9SfgVxK7Ai+fVo1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020