UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gDwQHzGBKoDqo/r5G+SVhwjLTIq3sDwACiQlLbW6JQE=' 
WHERE 
  key_id = 'dccef56eb3deab6c889c53c963fa4310f1b9a155abb1d2499de523c70a0f5c3d' 
  AND (
    token = 'gDwQHzGBKoDqo/r5G+SVhwjLTIq3sDwACiQlLbW6JQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025