UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5BZa3OVZJuYMyL24r0cD/1FPZRRreY9+hT6uM15PzVI=' 
WHERE 
  key_id = '6b4f9aed7c4417e85a1ea9a131f3f2d176dec5b05c17262cb1b1bb14cb5d0051' 
  AND (
    token = '5BZa3OVZJuYMyL24r0cD/1FPZRRreY9+hT6uM15PzVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027