UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Os5weLqPr4Yvhk5g2z/g42JZQ76bWBwpNd3RmmHNJY='
WHERE
key_id = '6ee9946e0b31e898982d2bca547fea3611e690918d42dd2c8d999ce19f334ca5'
AND (
token = '3Os5weLqPr4Yvhk5g2z/g42JZQ76bWBwpNd3RmmHNJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)