UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9llNCpEvyqAcXQlV+qngqDHN3yoJBLey8UVyfZ/YMQ=' 
WHERE 
  key_id = 'c4f3084045db427ac81712a5129e853173642cc180c8be334d50f8f15c9d4aaf' 
  AND (
    token = 'x9llNCpEvyqAcXQlV+qngqDHN3yoJBLey8UVyfZ/YMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033