UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3xX2cVcy0IYWkAjOwXXcoOK9I88ZIEjwc+Eson9BLCA='
WHERE
key_id = '2a5090b404696141552bb5aec0f04ee5782cd3a047432ee5f5d5522c0ccb4ea2'
AND (
token = '3xX2cVcy0IYWkAjOwXXcoOK9I88ZIEjwc+Eson9BLCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)