UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EFQe1bG8sp/qmQ4uGg8BsQxZ+T18evJzsZ6DUcqD5/k=' 
WHERE 
  key_id = '3fbfe46f97bf5b6fbc92eb242c14b8d8d6b6efb5fe06ce95f3e5373dab214ab8' 
  AND (
    token = 'EFQe1bG8sp/qmQ4uGg8BsQxZ+T18evJzsZ6DUcqD5/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024