UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A+iJWpNtjdGQzRn1yMybqs4xjl1LJZv6lAGXuWQRl7E=' 
WHERE 
  key_id = '46c0092c157d87591178d409613f2e72a5885a6a6ff3e3542e74e00860f46367' 
  AND (
    token = 'A+iJWpNtjdGQzRn1yMybqs4xjl1LJZv6lAGXuWQRl7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031