UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Dn86XN4Ip6ppDEl0hGlj86z2fGB7EJ8ui8DxgSS+DA='
WHERE
key_id = 'e7706182a76b7ffb2c9f12053169cdef5a657a5ad5237a86c321eb662dbd2930'
AND (
token = '3Dn86XN4Ip6ppDEl0hGlj86z2fGB7EJ8ui8DxgSS+DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)