UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+0X3lrWBIxSXYMnoHVPK0Som3RVJyBHvH4172uClWxQ='
WHERE
key_id = '8a75a072ebfdb958bcdc55e09c1d59a9ee9f96527fcbf897ffd8cf36cf677f54'
AND (
token = '+0X3lrWBIxSXYMnoHVPK0Som3RVJyBHvH4172uClWxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)