UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IY0R8AKkfMqSbCciHvaaI+QP0HOJzySg1/dbH4L9p8U='
WHERE
key_id = '38f13e1d7137dd7ec4e134688fa4a0dd2f618964f101e5ba867bc0b4c771acab'
AND (
token = 'IY0R8AKkfMqSbCciHvaaI+QP0HOJzySg1/dbH4L9p8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)