UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bkM+sxx4P+tZj2CKmCDHRcrE+N3l3xRA6eY0DXPtq4c='
WHERE
key_id = '232dbd6d5294f040c5d95de5608f8eea07b2f4388a52f42e6823c6aff39f364f'
AND (
token = 'bkM+sxx4P+tZj2CKmCDHRcrE+N3l3xRA6eY0DXPtq4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)