UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't3GvVoDvsrzvElerPf3GJs2vjrHHf6TRFY3WBFNOZ4M='
WHERE
key_id = '0dd2603cc99c8b04472bf0bcd0f3a27b04a6cdaa71ec878c9b75a7d24468ecb8'
AND (
token = 't3GvVoDvsrzvElerPf3GJs2vjrHHf6TRFY3WBFNOZ4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)