UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kyS01B3uE5PG/+2AxRZ615ch123qCIVWjk9LECRTOGc='
WHERE
key_id = 'af9be27a8ab2a373b825f164f0ab8ec3bdf4b81a011b9a4f3ef40204368c10cc'
AND (
token = 'kyS01B3uE5PG/+2AxRZ615ch123qCIVWjk9LECRTOGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)