UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3d67Dqt5WB03/YrSPm3DY46e2j0Qu+QsCD8N3Y8o7gM='
WHERE
key_id = '8b6cc50b79838c13536a5521bf880d8c2b476fcd1634a64b38a3e2f12102a32c'
AND (
token = '3d67Dqt5WB03/YrSPm3DY46e2j0Qu+QsCD8N3Y8o7gM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)