UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lFTaGJ+ZHI1DobfmMB0jyODZE+Y6J1lBklUTjto+5HM='
WHERE
key_id = '5e71e37fb0b7ac75205be14c2bce7f61ec03049e8540ca8ffda5ce03fce0c7b9'
AND (
token = 'lFTaGJ+ZHI1DobfmMB0jyODZE+Y6J1lBklUTjto+5HM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)