UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xk3M0Erfc+h0c+K/gaYxMX+mumUQnRd7/VPgenvPz3M='
WHERE
key_id = '8e6825b255d58b2fdc56dc81a2be8bcb10673acaf8c3f89448eb981a7f6698ae'
AND (
token = 'xk3M0Erfc+h0c+K/gaYxMX+mumUQnRd7/VPgenvPz3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)