UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0S5cxVenEiBA5wzqrS4+W3IzrfYneCvtDEePZjIl7No='
WHERE
key_id = '869b378a8d09b029b27796d05aa633ae0d315f95dd11319c227cd51c3668bb56'
AND (
token = '0S5cxVenEiBA5wzqrS4+W3IzrfYneCvtDEePZjIl7No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)