UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GR/jx8UI7pM8RdP/rzHD2Iuacdc1t1QfN1aFRjPqLAk='
WHERE
key_id = '0253589b3f3b37e9d2b8523972ca5916ea84ac055b2fdfa10d61704ca410a1da'
AND (
token = 'GR/jx8UI7pM8RdP/rzHD2Iuacdc1t1QfN1aFRjPqLAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)