UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zKSI5soE4VrwAgb+7pCpmhqGcwueA1wnuA0RQLPP1Qg='
WHERE
key_id = '20a3b5ab23c10c1a00048180265c16c892408d5e155a547bad10cae9f5920a8a'
AND (
token = 'zKSI5soE4VrwAgb+7pCpmhqGcwueA1wnuA0RQLPP1Qg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)