UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BbCU0FNSangH0XuLWXP1bzPw+HM2Bj9uheg7h3lBZFg=' 
WHERE 
  key_id = '6a799d91d3bfc15b1015501d7dcdeb852db9e08415f9a7dd569c6c7fed745a41' 
  AND (
    token = 'BbCU0FNSangH0XuLWXP1bzPw+HM2Bj9uheg7h3lBZFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038