UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4yP7mDk4/peikvrBmvqV1g6ErcAsmzVhxuZzbNm/e2c='
WHERE
key_id = '1884790c2b0251c73c784448837a2e25adcfc4ce77fbf10d78f89bd135f1957d'
AND (
token = '4yP7mDk4/peikvrBmvqV1g6ErcAsmzVhxuZzbNm/e2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)