UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1IJmthjRdkfmVneAuojJSdPAOxyN58hBoSHZTSafTmI='
WHERE
key_id = 'c780d86874cf5610f041d33144074bc46d940c663b24be5bb04fb9e7ee40c075'
AND (
token = '1IJmthjRdkfmVneAuojJSdPAOxyN58hBoSHZTSafTmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)