UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pOJ0otV0c+mAD5b7ym74wbGvG+gnmvbnra0+KnAldnA=' 
WHERE 
  key_id = '26782d271e5f7cd2cb4788c4776d66cec6c4681c9aa78144c439602a5ade2bef' 
  AND (
    token = 'pOJ0otV0c+mAD5b7ym74wbGvG+gnmvbnra0+KnAldnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030